<%
'#################################################################################
'## UnWritten Open Source Blog Engine
'#################################################################################
'## Copyright (C) 2008 Luigi Violin
'##
'## This program is free software: you can redistribute it and/or modify
'## it under the terms of the GNU General Public License as published by
'## the Free Software Foundation, either version 2 of the License, or
'## (at your option) any later version.
'##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'## GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License
'## along with this program.  If not, see <http://www.gnu.org/licenses/>.
'##
'## You can obtain support from our forums at:
'##     <http://www.unwrittenblog.com/forums/>
'## Contact the author directly:
'##     <zaamit@hotmail.com/>
'##
'#################################################################################
%>
<!--#include file="check-login.asp"-->
<!--#include file="header.asp"-->
<!--#include file="sidebar.asp"-->

<%
Dim wktitle,wkintro,wkpublish_status,wkoptions(9)
wktitle = ""
wkintro = ""
wkpublish_status = 1
wkaction = 1
for i = 0 to 9
	wkoptions(i) = ""
next
if request.QueryString("id") > 0 then
dbRS1.open "select * from " & db_prefix & "polls where id = " & request.QueryString("id"),dbConn
wktitle = dbRS1("title")
wkintro = dbRS1("intro")
wkpublish_status = dbRS1("status")
wkaction = 2
dbRS1.close
dbRS1.open "select * from " & db_prefix & "polls_options where pollid = " & request.QueryString("id") & " order by id",dbConn
i = 0
do while not dbRS1.eof
	wkoptions(i) = dbRS1("text")
	i = i + 1
	dbRS1.movenext
loop
dbRS1.close
end if
%>

<div id="main">
	<div id="inner">
<%
	if request.QueryString("s") <> ""then
		Response.Write(request.QueryString("s"))
	end if
%>
<form id="edit_poll" method="post" action="doedit-poll.asp">
<strong>Title</strong> <br /><input type="text" size="107" maxlength="250" id="title" name="title" value="<%=wktitle%>" />
<%=sep1%>
<strong>Intro</strong> <br /><input type="text" size="107" maxlength="250" id="intro" name="intro" value="<%=wkintro%>" />
<%=sep1%>
<strong>Options</strong><br />
<%
for i = 0 to 4
	Response.Write "<input type=""text"" size=""107"" name=""popt" & i+1 & """ value=""" & wkoptions(i) & """><br />" & vbcrlf
next
%>
<%=sep1%>
<strong>Expires in: </strong>
<select disabled="disabled">
<option value="0">No expire</option>
<select>
<%=FR%>
<%=sep1%>
<strong>Publish Status</strong> <input type="radio" name="status" value="1" <%if wkpublish_status = 1 then Response.Write "checked=""checked"""%> />Published &nbsp;&nbsp;<input type="radio" name="status" value="0" <%if wkpublish_status = 0 then Response.Write "checked=""checked"""%> />Unpublished
<%=sep1%>
<div class="form_buttons">
<input type="hidden" name="id" value="<%=request.QueryString("id")%>" />
<input type="hidden" name="action" value="<%=wkaction%>" />
<input type="submit" value="Save" class="big_button" />
</div>
</form>
<!-- /main inner --></div><!-- /main --></div>

<!--#include file="footer.asp"-->